home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / xain.c < prev    next >
C/C++ Source or Header  |  2000-04-23  |  20KB  |  585 lines

  1. /***************************************************************************
  2. Xain'd Sleena (TECHNOS), Solar Warrior (TAITO).
  3. By Carlos A. Lozano & Rob Rosenbrock & Phil Stroffolino
  4.  
  5.     - MC68B09EP (2)
  6.     - 6809EP (1)
  7.     - 68705 (dump not available; patched out in the bootleg)
  8.     - ym2203 (2)
  9.  
  10. TODO:
  11.     - understand how the vblank bit really works
  12.     - understand who triggers NMI and FIRQ on the first CPU
  13.     - 68705 protection (currently patched out, causes partial missing sprites)
  14.  
  15. ***************************************************************************/
  16.  
  17. #include "driver.h"
  18. #include "vidhrdw/generic.h"
  19. #include "cpu/m6809/m6809.h"
  20.  
  21. static unsigned char *xain_sharedram;
  22.  
  23. void xain_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  24. int xain_vh_start(void);
  25. WRITE_HANDLER( xain_scrollxP0_w );
  26. WRITE_HANDLER( xain_scrollyP0_w );
  27. WRITE_HANDLER( xain_scrollxP1_w );
  28. WRITE_HANDLER( xain_scrollyP1_w );
  29. WRITE_HANDLER( xain_charram_w );
  30. WRITE_HANDLER( xain_bgram0_w );
  31. WRITE_HANDLER( xain_bgram1_w );
  32. WRITE_HANDLER( xain_flipscreen_w );
  33.  
  34. extern unsigned char *xain_charram, *xain_bgram0, *xain_bgram1;
  35.  
  36.  
  37. READ_HANDLER( xain_sharedram_r )
  38. {
  39.     return xain_sharedram[offset];
  40. }
  41.  
  42. WRITE_HANDLER( xain_sharedram_w )
  43. {
  44.     /* locations 003d and 003e are used as a semaphores between CPU A and B, */
  45.     /* so let's resync every time they are changed to avoid deadlocks */
  46.     if ((offset == 0x003d || offset == 0x003e)
  47.             && xain_sharedram[offset] != data)
  48.         cpu_yield();
  49.     xain_sharedram[offset] = data;
  50. }
  51.  
  52. WRITE_HANDLER( xainCPUA_bankswitch_w )
  53. {
  54.     unsigned char *RAM = memory_region(REGION_CPU1);
  55.  
  56.     if (data & 0x08) {cpu_setbank(1,&RAM[0x10000]);}
  57.     else {cpu_setbank(1,&RAM[0x4000]);}
  58. }
  59.  
  60. WRITE_HANDLER( xainCPUB_bankswitch_w )
  61. {
  62.     unsigned char *RAM = memory_region(REGION_CPU2);
  63.  
  64.     if (data & 0x01) {cpu_setbank(2,&RAM[0x10000]);}
  65.     else {cpu_setbank(2,&RAM[0x4000]);}
  66. }
  67.  
  68. WRITE_HANDLER( xain_sound_command_w )
  69. {
  70.     soundlatch_w(offset,data);
  71.     cpu_cause_interrupt(2,M6809_INT_IRQ);
  72. }
  73.  
  74. static WRITE_HANDLER( xain_irqA_assert_w )
  75. {
  76.     cpu_set_irq_line(0,M6809_IRQ_LINE,ASSERT_LINE);
  77. }
  78.  
  79. static WRITE_HANDLER( xain_irqA_clear_w )
  80. {
  81.     cpu_set_irq_line(0,M6809_IRQ_LINE,CLEAR_LINE);
  82. }
  83.  
  84. static WRITE_HANDLER( xain_firqA_clear_w )
  85. {
  86.     cpu_set_irq_line(0,M6809_FIRQ_LINE,CLEAR_LINE);
  87. }
  88.  
  89. static WRITE_HANDLER( xain_irqB_assert_w )
  90. {
  91.     cpu_set_irq_line(1,M6809_IRQ_LINE,ASSERT_LINE);
  92. }
  93.  
  94. static WRITE_HANDLER( xain_irqB_clear_w )
  95. {
  96.     cpu_set_irq_line(1,M6809_IRQ_LINE,CLEAR_LINE);
  97. }
  98.  
  99. static READ_HANDLER( xain_68705_r )
  100. {
  101. //    logerror("read 68705\n");
  102.     return 0x4d;    /* fake P5 checksum test pass */
  103. }
  104.  
  105. static WRITE_HANDLER( xain_68705_w )
  106. {
  107. //    logerror("write %02x to 68705\n",data);
  108. }
  109.  
  110. static int xainA_interrupt(void)
  111. {
  112.     /* returning nmi on iloops() == 0 will cause lockups because the nmi handler */
  113.     /* waits for the vblank bit to be clear and there are other places in the code */
  114.     /* that wait for it to be set */
  115.     if (cpu_getiloops() == 2)
  116.         cpu_set_nmi_line(0,PULSE_LINE);
  117.     else
  118.         cpu_set_irq_line(0,M6809_FIRQ_LINE,ASSERT_LINE);
  119.     return M6809_INT_NONE;
  120. }
  121.  
  122.  
  123.  
  124. static struct MemoryReadAddress readmem[] =
  125. {
  126.     { 0x0000, 0x1fff, xain_sharedram_r },
  127.     { 0x2000, 0x37ff, MRA_RAM },
  128.     { 0x3a00, 0x3a00, input_port_0_r },
  129.     { 0x3a01, 0x3a01, input_port_1_r },
  130.     { 0x3a02, 0x3a02, input_port_2_r },
  131.     { 0x3a03, 0x3a03, input_port_3_r },
  132.     { 0x3a04, 0x3a04, xain_68705_r },    /* from the 68705 */
  133.     { 0x3a05, 0x3a05, input_port_4_r },
  134. //    { 0x3a06, 0x3a06, MRA_NOP },    /* ?? read (and discarded) on startup. Maybe reset the 68705 */
  135.     { 0x4000, 0x7fff, MRA_BANK1 },
  136.     { 0x8000, 0xffff, MRA_ROM },
  137.     { -1 }    /* end of table */
  138. };
  139.  
  140. static struct MemoryWriteAddress writemem[] =
  141. {
  142.     { 0x0000, 0x1fff, xain_sharedram_w, &xain_sharedram },
  143.     { 0x2000, 0x27ff, xain_charram_w, &xain_charram },
  144.     { 0x2800, 0x2fff, xain_bgram1_w, &xain_bgram1 },
  145.     { 0x3000, 0x37ff, xain_bgram0_w, &xain_bgram0 },
  146.     { 0x3800, 0x397f, MWA_RAM, &spriteram, &spriteram_size },
  147.     { 0x3a00, 0x3a01, xain_scrollxP1_w },
  148.     { 0x3a02, 0x3a03, xain_scrollyP1_w },
  149.     { 0x3a04, 0x3a05, xain_scrollxP0_w },
  150.     { 0x3a06, 0x3a07, xain_scrollyP0_w },
  151.     { 0x3a08, 0x3a08, xain_sound_command_w },
  152.     { 0x3a09, 0x3a09, MWA_NOP },    /* NMI acknowledge */
  153.     { 0x3a0a, 0x3a0a, xain_firqA_clear_w },
  154.     { 0x3a0b, 0x3a0b, xain_irqA_clear_w },
  155.     { 0x3a0c, 0x3a0c, xain_irqB_assert_w },
  156.     { 0x3a0d, 0x3a0d, xain_flipscreen_w },
  157.     { 0x3a0e, 0x3a0e, xain_68705_w },    /* to 68705 */
  158.     { 0x3a0f, 0x3a0f, xainCPUA_bankswitch_w },
  159.     { 0x3c00, 0x3dff, paletteram_xxxxBBBBGGGGRRRR_split1_w, &paletteram },
  160.     { 0x3e00, 0x3fff, paletteram_xxxxBBBBGGGGRRRR_split2_w, &paletteram_2 },
  161.     { 0x4000, 0xffff, MWA_ROM },
  162.     { -1 }    /* end of table */
  163. };
  164.  
  165. static struct MemoryReadAddress readmemB[] =
  166. {
  167.     { 0x0000, 0x1fff, xain_sharedram_r },
  168.     { 0x4000, 0x7fff, MRA_BANK2 },
  169.     { 0x8000, 0xffff, MRA_ROM },
  170.     { -1 }    /* end of table */
  171. };
  172.  
  173. static struct MemoryWriteAddress writememB[] =
  174. {
  175.     { 0x0000, 0x1fff, xain_sharedram_w },
  176.     { 0x2000, 0x2000, xain_irqA_assert_w },
  177.     { 0x2800, 0x2800, xain_irqB_clear_w },
  178.     { 0x3000, 0x3000, xainCPUB_bankswitch_w },
  179.     { 0x4000, 0xffff, MWA_ROM },
  180.     { -1 }    /* end of table */
  181. };
  182.  
  183. static struct MemoryReadAddress sound_readmem[] =
  184. {
  185.     { 0x0000, 0x07ff, MRA_RAM },
  186.     { 0x1000, 0x1000, soundlatch_r },
  187.     { 0x8000, 0xffff, MRA_ROM },
  188.     { -1 }    /* end of table */
  189. };
  190.  
  191. static struct MemoryWriteAddress sound_writemem[] =
  192. {
  193.     { 0x0000, 0x07ff, MWA_RAM },
  194.     { 0x2800, 0x2800, YM2203_control_port_0_w },
  195.     { 0x2801, 0x2801, YM2203_write_port_0_w },
  196.     { 0x3000, 0x3000, YM2203_control_port_1_w },
  197.     { 0x3001, 0x3001, YM2203_write_port_1_w },
  198.     { 0x4000, 0xffff, MWA_ROM },
  199.     { -1 }    /* end of table */
  200. };
  201.  
  202.  
  203.  
  204. INPUT_PORTS_START( xsleena )
  205.     PORT_START    /* IN0 */
  206.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  207.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  208.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
  209.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  210.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  211.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  212.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
  213.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
  214.  
  215.     PORT_START    /* IN1 */
  216.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  217.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  218.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  219.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  220.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  221.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  222.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
  223.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
  224.  
  225.     PORT_START    /* DSW0 */
  226.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) )
  227.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
  228.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  229.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  230.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) )
  231.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_A ) )
  232.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
  233.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
  234.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
  235.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) )
  236.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) )
  237.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  238.     PORT_DIPSETTING(    0x10, DEF_STR( On ) )
  239.     PORT_DIPNAME( 0x20, 0x20, "Allow Continue" )
  240.     PORT_DIPSETTING(    0x00, DEF_STR( No ) )
  241.     PORT_DIPSETTING(    0x20, DEF_STR( Yes ) )
  242.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
  243.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  244.     PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
  245.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Flip_Screen ) )
  246.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  247.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  248.  
  249.     PORT_START    /* DSW1 */
  250.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
  251.     PORT_DIPSETTING(    0x03, "Easy" )
  252.     PORT_DIPSETTING(    0x02, "Normal" )
  253.     PORT_DIPSETTING(    0x01, "Hard" )
  254.     PORT_DIPSETTING(    0x00, "Hardest" )
  255.     PORT_DIPNAME( 0x0c, 0x0c, "Game Time" )
  256.     PORT_DIPSETTING(    0x0c, "Slow" )
  257.     PORT_DIPSETTING(    0x08, "Normal" )
  258.     PORT_DIPSETTING(    0x04, "Fast" )
  259.     PORT_DIPSETTING(    0x00, "Very Fast" )
  260.     PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
  261.     PORT_DIPSETTING(    0x30, "20k 70k and every 70k" )
  262.     PORT_DIPSETTING(    0x20, "30k 80k and every 80k" )
  263.     PORT_DIPSETTING(    0x10, "20k and 80k" )
  264.     PORT_DIPSETTING(    0x00, "30k and 80k" )
  265.     PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) )
  266.     PORT_DIPSETTING(    0xc0, "3")
  267.     PORT_DIPSETTING(    0x80, "4")
  268.     PORT_DIPSETTING(    0x40, "6")
  269.     PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "Infinite", IP_KEY_NONE, IP_JOY_NONE )
  270.  
  271.     PORT_START    /* IN2 */
  272.     PORT_BIT( 0x03, IP_ACTIVE_LOW,  IPT_UNUSED )
  273.     PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_COIN3 )
  274.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* when 0, 68705 is ready to send data */
  275.     PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_UNKNOWN )    /* when 1, 68705 is ready to receive data */
  276.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_VBLANK )
  277.     PORT_BIT( 0xc0, IP_ACTIVE_LOW,  IPT_UNUSED )
  278. INPUT_PORTS_END
  279.  
  280.  
  281.  
  282. static struct GfxLayout charlayout =
  283. {
  284.     8,8,    /* 8*8 chars */
  285.     1024,    /* 1024 characters */
  286.     4,    /* 4 bits per pixel */
  287.     { 0, 2, 4, 6 },    /* plane offset */
  288.     { 1, 0, 8*8+1, 8*8+0, 16*8+1, 16*8+0, 24*8+1, 24*8+0 },
  289.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  290.     32*8    /* every char takes 32 consecutive bytes */
  291. };
  292.  
  293. static struct GfxLayout tilelayout =
  294. {
  295.     16,16,    /* 8*8 chars */
  296.     4*512,    /* 512 characters */
  297.     4,    /* 4 bits per pixel */
  298.     { 0x8000*4*8+0, 0x8000*4*8+4, 0, 4 },    /* plane offset */
  299.     { 3, 2, 1, 0, 16*8+3, 16*8+2, 16*8+1, 16*8+0,
  300.       32*8+3,32*8+2 ,32*8+1 ,32*8+0 ,48*8+3 ,48*8+2 ,48*8+1 ,48*8+0 },
  301.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  302.       8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
  303.     64*8    /* every char takes 64 consecutive bytes */
  304. };
  305.  
  306. static struct GfxDecodeInfo gfxdecodeinfo[] =
  307. {
  308.     { REGION_GFX1, 0, &charlayout,   0, 8 },    /* 8x8 text */
  309.     { REGION_GFX2, 0, &tilelayout, 256, 8 },    /* 16x16 Background */
  310.     { REGION_GFX3, 0, &tilelayout, 384, 8 },    /* 16x16 Background */
  311.     { REGION_GFX4, 0, &tilelayout, 128, 8 },    /* Sprites */
  312.     { -1 } /* end of array */
  313. };
  314.  
  315.  
  316.  
  317. /* handler called by the 2203 emulator when the internal timers cause an IRQ */
  318. static void irqhandler(int irq)
  319. {
  320.     cpu_set_irq_line(2,M6809_FIRQ_LINE,irq ? ASSERT_LINE : CLEAR_LINE);
  321. }
  322.  
  323. static struct YM2203interface ym2203_interface =
  324. {
  325.     2,            /* 2 chips */
  326.     3000000,    /* 3 MHz ??? */
  327.     { YM2203_VOL(40,50), YM2203_VOL(40,50) },
  328.     { 0 },
  329.     { 0 },
  330.     { 0 },
  331.     { 0 },
  332.     { irqhandler }
  333. };
  334.  
  335.  
  336.  
  337. static struct MachineDriver machine_driver_xsleena =
  338. {
  339.     {
  340.         {
  341.             CPU_M6809,
  342.             2000000,    /* 2 Mhz ??? */
  343.             readmem,writemem,0,0,
  344.             xainA_interrupt,4    /* wrong, this is just a hack */
  345.                                 /* IRQs are caused by CPU B */
  346.                                 /* FIRQs are caused by ? */
  347.                                 /* NMIs are caused by... vblank it seems, but it checks */
  348.                                 /* the vblank bit before RTI, and there are other places in */
  349.                                 /* the code that check that bit, so it would cause lockups */
  350.         },
  351.         {
  352.             CPU_M6809,
  353.             2000000,    /* 2 Mhz ??? */
  354.             readmemB,writememB,0,0,
  355.             ignore_interrupt,0    /* IRQs are caused by CPU A */
  356.         },
  357.         {
  358.             CPU_M6809 | CPU_AUDIO_CPU,
  359.             2000000,    /* 2 Mhz ??? */
  360.             sound_readmem,sound_writemem,0,0,
  361.             ignore_interrupt,0    /* IRQs are caused by CPU A */
  362.                                 /* FIRQs are caused by the YM2203 */
  363.         },
  364.     },
  365.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
  366.     100,    /* 100 CPU slice per frame */
  367.     0,
  368.  
  369.     /* video hardware */
  370.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  371.     gfxdecodeinfo,
  372.     512, 512,
  373.     0,
  374.  
  375.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  376.     0,
  377.     xain_vh_start,
  378.     0,
  379.     xain_vh_screenrefresh,
  380.  
  381.     /* sound hardware */
  382.     0,0,0,0,
  383.     {
  384.         {
  385.             SOUND_YM2203,
  386.             &ym2203_interface
  387.         }
  388.     }
  389. };
  390.  
  391.  
  392.  
  393. /***************************************************************************
  394.  
  395.   Game driver(s)
  396.  
  397. ***************************************************************************/
  398.  
  399. ROM_START( xsleena )
  400.     ROM_REGION( 0x14000, REGION_CPU1 )    /* 64k for code */
  401.     ROM_LOAD( "s-10.7d",      0x08000, 0x8000, 0x370164be )
  402.     ROM_LOAD( "s-11.7c",      0x04000, 0x4000, 0xd22bf859 )
  403.     ROM_CONTINUE(             0x10000, 0x4000 )
  404.  
  405.     ROM_REGION( 0x14000, REGION_CPU2 )    /* 64k for code */
  406.     ROM_LOAD( "s-2.3b",       0x08000, 0x8000, 0xa1a860e2 )
  407.     ROM_LOAD( "s-1.2b",       0x04000, 0x4000, 0x948b9757 )
  408.     ROM_CONTINUE(             0x10000, 0x4000 )
  409.  
  410.     ROM_REGION( 0x10000, REGION_CPU3 )    /* 64k for code */
  411.     ROM_LOAD( "s-3.4s",       0x8000, 0x8000, 0xa5318cb8 )
  412.  
  413.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  414.     ROM_LOAD( "s-12.8b",      0x00000, 0x8000, 0x83c00dd8 ) /* chars */
  415.  
  416.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  417.     ROM_LOAD( "s-21.16i",     0x00000, 0x8000, 0x11eb4247 ) /* tiles */
  418.     ROM_LOAD( "s-22.15i",     0x08000, 0x8000, 0x422b536e )
  419.     ROM_LOAD( "s-23.14i",     0x10000, 0x8000, 0x828c1b0c )
  420.     ROM_LOAD( "s-24.13i",     0x18000, 0x8000, 0xd37939e0 )
  421.     ROM_LOAD( "s-13.16g",     0x20000, 0x8000, 0x8f0aa1a7 )
  422.     ROM_LOAD( "s-14.15g",     0x28000, 0x8000, 0x45681910 )
  423.     ROM_LOAD( "s-15.14g",     0x30000, 0x8000, 0xa8eeabc8 )
  424.     ROM_LOAD( "s-16.13g",     0x38000, 0x8000, 0xe59a2f27 )
  425.  
  426.     ROM_REGION( 0x40000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  427.     ROM_LOAD( "s-6.4h",       0x00000, 0x8000, 0x5c6c453c ) /* tiles */
  428.     ROM_LOAD( "s-5.4l",       0x08000, 0x8000, 0x59d87a9a )
  429.     ROM_LOAD( "s-4.4m",       0x10000, 0x8000, 0x84884a2e )
  430.     /* 0x60000-0x67fff empty */
  431.     ROM_LOAD( "s-7.4f",       0x20000, 0x8000, 0x8d637639 )
  432.     ROM_LOAD( "s-8.4d",       0x28000, 0x8000, 0x71eec4e6 )
  433.     ROM_LOAD( "s-9.4c",       0x30000, 0x8000, 0x7fc9704f )
  434.     /* 0x80000-0x87fff empty */
  435.  
  436.     ROM_REGION( 0x40000, REGION_GFX4 | REGIONFLAG_DISPOSE )
  437.     ROM_LOAD( "s-25.10i",     0x00000, 0x8000, 0x252976ae ) /* sprites */
  438.     ROM_LOAD( "s-26.9i",      0x08000, 0x8000, 0xe6f1e8d5 )
  439.     ROM_LOAD( "s-27.8i",      0x10000, 0x8000, 0x785381ed )
  440.     ROM_LOAD( "s-28.7i",      0x18000, 0x8000, 0x59754e3d )
  441.     ROM_LOAD( "s-17.10g",     0x20000, 0x8000, 0x4d977f33 )
  442.     ROM_LOAD( "s-18.9g",      0x28000, 0x8000, 0x3f3b62a0 )
  443.     ROM_LOAD( "s-19.8g",      0x30000, 0x8000, 0x76641ee3 )
  444.     ROM_LOAD( "s-20.7g",      0x38000, 0x8000, 0x37671f36 )
  445.  
  446.     ROM_REGION( 0x0100, REGION_PROMS )
  447.     ROM_LOAD( "mb7114e.59",   0x0000, 0x0100, 0xfed32888 )    /* timing? (not used) */
  448. ROM_END
  449.  
  450. ROM_START( xsleenab )
  451.     ROM_REGION( 0x14000, REGION_CPU1 )    /* 64k for code */
  452.     ROM_LOAD( "1.rom",        0x08000, 0x8000, 0x79f515a7 )
  453.     ROM_LOAD( "s-11.7c",      0x04000, 0x4000, 0xd22bf859 )
  454.     ROM_CONTINUE(             0x10000, 0x4000 )
  455.  
  456.     ROM_REGION( 0x14000, REGION_CPU2 )    /* 64k for code */
  457.     ROM_LOAD( "s-2.3b",       0x08000, 0x8000, 0xa1a860e2 )
  458.     ROM_LOAD( "s-1.2b",       0x04000, 0x4000, 0x948b9757 )
  459.     ROM_CONTINUE(             0x10000, 0x4000 )
  460.  
  461.     ROM_REGION( 0x10000, REGION_CPU3 )    /* 64k for code */
  462.     ROM_LOAD( "s-3.4s",       0x8000, 0x8000, 0xa5318cb8 )
  463.  
  464.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  465.     ROM_LOAD( "s-12.8b",      0x00000, 0x8000, 0x83c00dd8 ) /* chars */
  466.  
  467.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  468.     ROM_LOAD( "s-21.16i",     0x00000, 0x8000, 0x11eb4247 ) /* tiles */
  469.     ROM_LOAD( "s-22.15i",     0x08000, 0x8000, 0x422b536e )
  470.     ROM_LOAD( "s-23.14i",     0x10000, 0x8000, 0x828c1b0c )
  471.     ROM_LOAD( "s-24.13i",     0x18000, 0x8000, 0xd37939e0 )
  472.     ROM_LOAD( "s-13.16g",     0x20000, 0x8000, 0x8f0aa1a7 )
  473.     ROM_LOAD( "s-14.15g",     0x28000, 0x8000, 0x45681910 )
  474.     ROM_LOAD( "s-15.14g",     0x30000, 0x8000, 0xa8eeabc8 )
  475.     ROM_LOAD( "s-16.13g",     0x38000, 0x8000, 0xe59a2f27 )
  476.  
  477.     ROM_REGION( 0x40000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  478.     ROM_LOAD( "s-6.4h",       0x00000, 0x8000, 0x5c6c453c ) /* tiles */
  479.     ROM_LOAD( "s-5.4l",       0x08000, 0x8000, 0x59d87a9a )
  480.     ROM_LOAD( "s-4.4m",       0x10000, 0x8000, 0x84884a2e )
  481.     /* 0x60000-0x67fff empty */
  482.     ROM_LOAD( "s-7.4f",       0x20000, 0x8000, 0x8d637639 )
  483.     ROM_LOAD( "s-8.4d",       0x28000, 0x8000, 0x71eec4e6 )
  484.     ROM_LOAD( "s-9.4c",       0x30000, 0x8000, 0x7fc9704f )
  485.     /* 0x80000-0x87fff empty */
  486.  
  487.     ROM_REGION( 0x40000, REGION_GFX4 | REGIONFLAG_DISPOSE )
  488.     ROM_LOAD( "s-25.10i",     0x00000, 0x8000, 0x252976ae ) /* sprites */
  489.     ROM_LOAD( "s-26.9i",      0x08000, 0x8000, 0xe6f1e8d5 )
  490.     ROM_LOAD( "s-27.8i",      0x10000, 0x8000, 0x785381ed )
  491.     ROM_LOAD( "s-28.7i",      0x18000, 0x8000, 0x59754e3d )
  492.     ROM_LOAD( "s-17.10g",     0x20000, 0x8000, 0x4d977f33 )
  493.     ROM_LOAD( "s-18.9g",      0x28000, 0x8000, 0x3f3b62a0 )
  494.     ROM_LOAD( "s-19.8g",      0x30000, 0x8000, 0x76641ee3 )
  495.     ROM_LOAD( "s-20.7g",      0x38000, 0x8000, 0x37671f36 )
  496.  
  497.     ROM_REGION( 0x0100, REGION_PROMS )
  498.     ROM_LOAD( "mb7114e.59",   0x0000, 0x0100, 0xfed32888 )    /* timing? (not used) */
  499. ROM_END
  500.  
  501. ROM_START( solarwar )
  502.     ROM_REGION( 0x14000, REGION_CPU1 )    /* 64k for code */
  503.     ROM_LOAD( "p9-0.bin",     0x08000, 0x8000, 0x8ff372a8 )
  504.     ROM_LOAD( "pa-0.bin",     0x04000, 0x4000, 0x154f946f )
  505.     ROM_CONTINUE(             0x10000, 0x4000 )
  506.  
  507.     ROM_REGION( 0x14000, REGION_CPU2 )    /* 64k for code */
  508.     ROM_LOAD( "p1-0.bin",     0x08000, 0x8000, 0xf5f235a3 )
  509.     ROM_LOAD( "p0-0.bin",     0x04000, 0x4000, 0x51ae95ae )
  510.     ROM_CONTINUE(             0x10000, 0x4000 )
  511.  
  512.     ROM_REGION( 0x10000, REGION_CPU3 )    /* 64k for code */
  513.     ROM_LOAD( "s-3.4s",       0x8000, 0x8000, 0xa5318cb8 )
  514.  
  515.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  516.     ROM_LOAD( "s-12.8b",      0x00000, 0x8000, 0x83c00dd8 ) /* chars */
  517.  
  518.     ROM_REGION( 0x40000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  519.     ROM_LOAD( "s-21.16i",     0x00000, 0x8000, 0x11eb4247 ) /* tiles */
  520.     ROM_LOAD( "s-22.15i",     0x08000, 0x8000, 0x422b536e )
  521.     ROM_LOAD( "s-23.14i",     0x10000, 0x8000, 0x828c1b0c )
  522.     ROM_LOAD( "pn-0.bin",     0x18000, 0x8000, 0xd2ed6f94 )
  523.     ROM_LOAD( "s-13.16g",     0x20000, 0x8000, 0x8f0aa1a7 )
  524.     ROM_LOAD( "s-14.15g",     0x28000, 0x8000, 0x45681910 )
  525.     ROM_LOAD( "s-15.14g",     0x30000, 0x8000, 0xa8eeabc8 )
  526.     ROM_LOAD( "pf-0.bin",     0x38000, 0x8000, 0x6e627a77 )
  527.  
  528.     ROM_REGION( 0x40000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  529.     ROM_LOAD( "s-6.4h",       0x00000, 0x8000, 0x5c6c453c ) /* tiles */
  530.     ROM_LOAD( "s-5.4l",       0x08000, 0x8000, 0x59d87a9a )
  531.     ROM_LOAD( "s-4.4m",       0x10000, 0x8000, 0x84884a2e )
  532.     /* 0x60000-0x67fff empty */
  533.     ROM_LOAD( "s-7.4f",       0x20000, 0x8000, 0x8d637639 )
  534.     ROM_LOAD( "s-8.4d",       0x28000, 0x8000, 0x71eec4e6 )
  535.     ROM_LOAD( "s-9.4c",       0x30000, 0x8000, 0x7fc9704f )
  536.     /* 0x80000-0x87fff empty */
  537.  
  538.     ROM_REGION( 0x40000, REGION_GFX4 | REGIONFLAG_DISPOSE )
  539.     ROM_LOAD( "s-25.10i",     0x00000, 0x8000, 0x252976ae )    /* sprites */
  540.     ROM_LOAD( "s-26.9i",      0x08000, 0x8000, 0xe6f1e8d5 )
  541.     ROM_LOAD( "s-27.8i",      0x10000, 0x8000, 0x785381ed )
  542.     ROM_LOAD( "s-28.7i",      0x18000, 0x8000, 0x59754e3d )
  543.     ROM_LOAD( "s-17.10g",     0x20000, 0x8000, 0x4d977f33 )
  544.     ROM_LOAD( "s-18.9g",      0x28000, 0x8000, 0x3f3b62a0 )
  545.     ROM_LOAD( "s-19.8g",      0x30000, 0x8000, 0x76641ee3 )
  546.     ROM_LOAD( "s-20.7g",      0x38000, 0x8000, 0x37671f36 )
  547.  
  548.     ROM_REGION( 0x0100, REGION_PROMS )
  549.     ROM_LOAD( "mb7114e.59",   0x0000, 0x0100, 0xfed32888 )    /* timing? (not used) */
  550. ROM_END
  551.  
  552.  
  553.  
  554. void init_xsleena(void)
  555. {
  556.     unsigned char *RAM = memory_region(REGION_CPU1);
  557.  
  558.     /* do the same patch as the bootleg xsleena */
  559.     RAM[0xd488] = 0x12;
  560.     RAM[0xd489] = 0x12;
  561.     RAM[0xd48a] = 0x12;
  562.     RAM[0xd48b] = 0x12;
  563.     RAM[0xd48c] = 0x12;
  564.     RAM[0xd48d] = 0x12;
  565. }
  566.  
  567. void init_solarwar(void)
  568. {
  569.     unsigned char *RAM = memory_region(REGION_CPU1);
  570.  
  571.     /* do the same patch as the bootleg xsleena */
  572.     RAM[0xd47e] = 0x12;
  573.     RAM[0xd47f] = 0x12;
  574.     RAM[0xd480] = 0x12;
  575.     RAM[0xd481] = 0x12;
  576.     RAM[0xd482] = 0x12;
  577.     RAM[0xd483] = 0x12;
  578. }
  579.  
  580.  
  581.  
  582. GAME( 1986, xsleena,  0,       xsleena, xsleena, xsleena,  ROT0, "Technos", "Xain'd Sleena" )
  583. GAME( 1986, xsleenab, xsleena, xsleena, xsleena, 0,        ROT0, "bootleg", "Xain'd Sleena (bootleg)" )
  584. GAME( 1986, solarwar, xsleena, xsleena, xsleena, solarwar, ROT0, "[Technos] Taito (Memetron license)", "Solar Warrior" )
  585.